Constructs a quaternion from a 4-element array stored such that [w, x, y, z].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(4) | :: | x |
The array from which to initialize the quaternion stored in the order [w, x, y, z]. |
The resulting quaternion.
Constructs a quaternion given an axis and the angle of rotation about the axis.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | angle |
The rotation angle, in radians. |
||
| real(kind=real64), | intent(in), | dimension(3) | :: | axis |
A 3-element vector defining the axis about which the rotation occurrs. |
The resulting quaternion.
Constructs a quaternion from a 3-by-3 rotation matrix using the Stanley method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(3, 3) | :: | r |
The rotation matrix. |
The resulting quaternion.